package com.rlyy.basic.resolver.valid.check;

import javax.validation.Validator;
import javax.validation.ValidatorFactory;

/**
 * 快速失败校验、因Spring默认将LocalValidatorFactoryBean设置为Primary、注入快速失败校验器不能返回Validator类型
 * 将Validator再包装一层注册此对象
 *
 * @author yuanqinglong
 * @since 2021/4/16 15:17
 */
public class ValidatorFailFastFactory {

    private final ValidatorFactory validator;

    public ValidatorFailFastFactory(ValidatorFactory validator) {
        this.validator = validator;
    }

    public Validator getValidator() {
        return validator.getValidator();
    }
}
